Skip to content

Rust: Move local name resolution logic into shared library#21873

Draft
hvitved wants to merge 3 commits into
github:mainfrom
hvitved:local-name-resolution
Draft

Rust: Move local name resolution logic into shared library#21873
hvitved wants to merge 3 commits into
github:mainfrom
hvitved:local-name-resolution

Conversation

@hvitved
Copy link
Copy Markdown
Contributor

@hvitved hvitved commented May 20, 2026

No description provided.

@github-actions github-actions Bot added the Rust Pull requests that update Rust code label May 20, 2026
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/LocalNameBinding.qll Fixed
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/LocalNameBinding.qll Fixed
Comment thread rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll Fixed
class NestedFunctionAccess extends LocalAccess {
private Function f;

NestedFunctionAccess() { nestedFunctionAccess(_, f, this) }
@hvitved hvitved force-pushed the local-name-resolution branch from 46e6643 to 78a5319 Compare May 21, 2026 12:58
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed

/** Gets the name of this variable as a string. */
string getText() { result = text }
predicate accessCand(AstNode n, string name) {
/**
* Holds if `n` is a node that may access a local named `name`.
*/
predicate accessCand(AstNode n, string name);
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed
@hvitved hvitved force-pushed the local-name-resolution branch from 0de851d to 35ff093 Compare May 21, 2026 14:46
Comment thread shared/namebinding/codeql/namebinding/LocalNameBinding.qll Fixed
@hvitved hvitved force-pushed the local-name-resolution branch from 35ff093 to cad848a Compare May 21, 2026 14:49
* We also move any `else` branch _before_ the condition to ensure that shadowing declarations
* inside the condition are not in scope.
*/
private AstNode getChildAdj(AstNode parent, int index) {
@hvitved hvitved force-pushed the local-name-resolution branch 3 times, most recently from 9ce2e74 to baef7eb Compare May 22, 2026 08:01

class Ranked = AstNode;

int getRank(C parent, Ranked child) {
@hvitved hvitved force-pushed the local-name-resolution branch from baef7eb to 59b8380 Compare May 22, 2026 13:03
@hvitved hvitved force-pushed the local-name-resolution branch from 59b8380 to 0f3ee22 Compare May 22, 2026 13:24
@hvitved
Copy link
Copy Markdown
Contributor Author

hvitved commented May 22, 2026

@hvitved
Copy link
Copy Markdown
Contributor Author

hvitved commented May 22, 2026

Rerun has been triggered: 1 restarted 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants